<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<%@page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
<style>
.login a:hover img {src='<c:url value="/images/login1.png"/>'}
</style>
<title>Login</title>
</head>
<body>

<script type="text/javascript"
	src="<c:url value="/js/jquery-1.9.1.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-ui-1.8.24.js"/>"></script>	
<script type="text/javascript"	src="<c:url value="/js/e2e/aes.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/js/e2e/base64.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/js/e2e/e2e.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/js/e2e/jsbn.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/js/e2e/prng4.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/js/e2e/rng.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/js/e2e/rsa.js"/>"></script>
<script type="text/javascript">
${rsascript}
function e2eelogin(id) {
    var rsa = getRSA();
    var aes = new AES(128);

    var input_pass = $("#password").val();
    //get the password
    var encryptedPass = aes.encrypt(input_pass);
    var encryptedAesKey = rsa.encrypt(aes.key);

    var result = encryptedAesKey + '|' + encryptedPass;

     $("#password").val(result);
    return true;
}

function login(){
e2eelogin();
$("#loginForm").submit();
}
</script>
<form action="${ctx}/account/login" method="post" id="loginForm" name="loginForm">
	<input type="hidden" name="redirectURL" value="${redirectURL}"/>
	用户名：<input name="username" type="text" id="username"/>
	<br/>
	密码：<input type="password" name="password" id="password"/>
	<br/>
	<div class="login">
	<a onclick="javascript:login();"><img src='<c:url value="/images/login.png"/>' onmouseover="this.src='<c:url value="/images/login1.png"/>'" onmouseout="this.src='<c:url value="/images/login.png"/>'"/></a>
	</div>
	
</form>
</body>
</html>